package com.example.rxandroid;

import androidx.lifecycle.ViewModel;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.Flowable;

public class MainViewModel extends ViewModel {

    List<String> list = new ArrayList<>();

    Flowable<String> getMessage(){
        return Flowable.fromIterable(list);
    }

    public void addMessage(String str){
        list.add(str);
    }
}
